#include <iostream>
#include <pthread.h>
#include <unistd.h>
using namespace std;

void *thread_func(void *arg) 
{
    printf("子线程任务完成\n");
    pthread_exit((void*)100);  
    sleep(200);
}

int main() 
{
    pthread_t tid;
    void *ret;
    pthread_create(&tid, NULL, thread_func, NULL);
    pthread_join(tid, &ret);  
    printf("子线程退出状态：%ld\n", (long)ret);
    return 0;
}